package com.lagou.edu.dao;

import com.lagou.edu.pojo.LagouToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface UserDao extends JpaRepository<LagouToken, Integer> {

    @Modifying
    @Query(value = "update lagou_token set token =:token  where email = :email",nativeQuery = true)
    @Transactional
    int updateToken(String email, String token);
}
